-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests which don't specify explicit URI #265
Conversation
When running JCA without an explicit intent mode, the files are saved to MediaStore. This installs a watch on the MediaStore to delete any files that are created during tests.
Video capture seems to be saving a 3gp file without the filename specified. Remove the "JCA" prefix check for now in order to ensure this file gets deleted in tests.
} | ||
put(displayName, outputUri) | ||
} | ||
cursor.moveToNext() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just making sure, this cursor doesn't need to be closed right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cursor is automatically closed by virtue of accessing it via a use {}
block (on line 69).
mediaUri = mediaUri, | ||
instrumentation = instrumentation, | ||
filePrefix = filePrefix | ||
).take(expectedNumFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble understanding this line. The observer sends all changed files upon and they are put into the entries. What does ".take(expectedNumFiles)" do?
It seems it has to do with runScenarioTest() succeeding, but how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flow.take will transform the flow into another flow that only contains expectedNumFiles
elements. This means the flow will complete once the expected number of files has been received, and execution will continue past the collect
block. When the number of files produced is less than expectedNumFiles
, the collect
block will suspend while waiting for the next result.
When running JCA without an explicit intent mode, the files are
saved to MediaStore. This installs a watch on the MediaStore to
delete any files that are created during tests.